Skip to content

fix: retry recovered credential decrypt failures - #700

Closed
Avilianb wants to merge 1 commit into
chenyme:mainfrom
Avilianb:agent/recover-decrypt-failed-credentials
Closed

fix: retry recovered credential decrypt failures#700
Avilianb wants to merge 1 commit into
chenyme:mainfrom
Avilianb:agent/recover-decrypt-failed-credentials

Conversation

@Avilianb

Copy link
Copy Markdown

Summary

  • Retry a manually requested credential refresh when its only permanent marker is credential_decrypt_failed.
  • Include those recovered reauthRequired credentials in the bulk refresh candidate set.
  • Preserve the permanent block for genuine OAuth failures such as invalid_grant.

Root cause

A temporary credential-encryption-key mismatch can mark a valid refresh token as permanently failed. After the correct key is restored, both manual and bulk refresh paths still stopped before attempting a refresh.

Validation

  • go test ./internal/application/account -run '^(TestCredentialRefreshFailureDistinguishesTransientAndPermanent|TestRefreshTokenRetriesRecoveredCredentialDecryptFailure|TestRefreshAllTokensRetriesRecoveredCredentialDecryptFailures|TestRefreshAllTokensSkipsUnrefreshableAccounts)$' -count=1
  • go test ./internal/infra/persistence/relational -count=1 was attempted, but an unrelated Windows temporary-directory cleanup error occurred in TestBuildSuperEntitledNonBuildForcedFalse after the tests ran.

@github-actions

Copy link
Copy Markdown
Contributor

This pull request has had no activity for 7 days. It will be closed in 7 days if there is no further activity.

@github-actions github-actions Bot added the stale label Jul 26, 2026
@chenyme chenyme closed this Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants